<?php
//カスタム

//password to gain access
$password = 'admin123';

//directory relative to this file to search for databases (if false, manually list databases in the $databases variable)
$directory = app_path().'/database';

function custom_download($databases, $name) {
  $db = null;
  foreach($databases as $d) {
    if ($d['name']==$name) {$db = $d;break;}
  }
  if ($db!=null) {
    header("Content-Type: application/octet-stream");
    header("Content-Disposition: attachment; filename=".basename($db['path']));
    header("Pragma: no-cache");
    header("Expires: 0");

    readfile($db['path']);
  }
  exit();
}
